Developer Documentation

QuickTime 4 API Documentation

QuickTime For Windows Programmers

| Previous | Chapter Contents | Chapter Top | Next |

Access to Windows Data Structures

The utility functions described in this section provide access to Windows data structures that QuickTime uses as part of its implementation.

CreatePortAssociation

CreatePortAssociation associates a graphics port (a data structure of type GrafPort ) with an onscreen native window.

GrafPtr CreatePortAssociation(void *theWnd, Ptr wStorage, long flags);
theWnd
Native window to associate the GrafPort with. In Windows, this parameter represents the movie HWND .
wStorage
A pointer to a window record used for window storage. If you specify NIL , this function will allocate storage for you.
flags
Option flags:
kQTMLNoIdleEvents
If you set this flag, QuickTime will not pass periodic idle messages to the WndProc associated with this window. In this case it is your responsibility to task any movies playing in this window. When this flag is not set, QuickTime makes sure the WndProc associated with the onscreen window gets periodic idle messages so your code can in turn idle any movie controllers contained within that window.

DISCUSSION

The CreatePortAssociation function associates a QuickDraw graphics port with an onscreen window. The graphics port provides a drawing context for QuickTime and QuickDraw. In addition, QuickTime hooks the native window, so that any window state changes are reflected in the associated graphics port. Before you dispose of the native window, call DestroyPortAssociation .

DestroyPortAssociation

DestroyPortAssociation removes the graphics port associated with an onscreen window.

void DestroyPortAssociation(CGrafPtr cgp);
cgp
A pointer to the QuickDraw graphics port associated with a native window.

DISCUSSION

The DestroyPortAssociation function removes the graphics port associated with an onscreen native window. This association was established previously via the CreatePortAssociation call. The DestroyPortAssociation function unhooks the native window WndProc and deallocates and window storage. Call this function before you destroy the native window.

UpdatePort

The UpdatePort function forces the update of the port.

OSErr UpdatePort(GrafPtr port);
port
A Mac OS graphics port.

DISCUSSION

This routine updates the various fields of a graphics port from the current HWND settings. The port's visRgn , strucRgn , and bounds are updated.

GetHWNDPort

The GetHWNDPort function gets a Mac OS graphics port pointer for a Windows HWND window handle.

GrafPtr GetHWNDPort(void *theHWND);
theHWND
A window handle
function result
A pointer to a Mac OS GrafPort data structure.

GetPortHDC

The GetPortHDC function returns a Windows HDC .

void *GetPortHDC(GrafPtr port);
port
A Mac OS graphics port.
function result
A Windows HDC .

GetPortHBITMAP

The GetPortHBITMAP function returns a HBITMAP .

void *GetPortHBITMAP(GrafPtr port);
port
A Mac OS graphics port.
function result
A Windows HBITMAP .

DISCUSSION

Use this routine to get the HBITMAP object associated with an offscreen graphics world. This HBITMAP will be a DIBSECTION . Do not dispose of this HBITMAP .

GetPortHPALETTE

The GetPortHPALETTE function returns a HPALETTE.

void *GetPortHPALETTE(GrafPtr port);
port
A Mac OS graphics port.
function result
A Windows HPALETTE .

GetPortHFONT

The GetPortHFONT function returns a handle to the currently-selected Windows font.

void *GetPortHFONT(GrafPtr port);
port
A Mac OS graphics port.
function result
A Windows font.

QTGetDDObject

The QTGetDDObject function returns the Direct Draw object currently in use by QuickTime.

OSErr QTGetDDObject(void **lpDDObject);
lpDDObject
Specifies the DirectDraw object.

DISCUSSION

This function is useful for developers who want to call DirectDraw methods directly.

QTSetDDObject

The QTSetDDObject function sets the DirectDraw object currently in use by QuickTime.

OSErr QTSetDDObject(void *lpNewDDObject);
lpNewDDObject
Specifies the DirectDraw object.

This function is useful for developers who want to call DirectDraw methods directly.

QTSetDDPrimarySurface

The QTSetDDPrimarySurface function allows you to set the primary DirectDraw surface used by QuickTime.

OSErr QTSetDDPrimarySurface(void *lpNewDDSurface, unsigned long flags);
lpNewDDSurface
Contains a pointer to a DirectDraw surface.
flags
Contains flags that control the set operation. The following flags are valid:
kDDSurfaceLocked
If set, QuickTime won't attempt to lock the graphics device when blitting to the PixMap .
kDDSurfaceStatic
If set, QuickTime assumes Windows on this device do not move.

DISCUSSION

This function is useful for multimedia developers who want to wrap QuickTime around surfaces they have already created.

InitializeQHdr

InitializeQHdr initializes a Windows QHdr data structure for use by the Toolbox.

void InitializeQHdr(QHdr *qhdr);
qhdr
A pointer to a QHdr record.

DISCUSSION

The InitializeQHdr function initializes the various fields of the Windows queue header to startup values and associates a mutex with the queue to provide safe access via the Toolbox Enqueue and Dequeue routines. The mutex identifier is stored in the MutexID field of the QHdr . Your application or component is not required to manage this mutex; the Toolbox functions Enqueue and Dequeue will handle this for you. A QHdr structure is typically used by QuickTime image decompressor components to manage frame queues. Once you are done with the queue, call TerminateQHdr to free the mutex.

TerminateQHdr

InitializeQHdr terminates a Windows QHdr data structure.

void TerminateQHdr (QHdr *qhdr);
qhdr
A pointer to a QHdr record.

DISCUSSION

The TerminateQHdr function deallocates the data structures created by InitializeQHdr .

IsTaskBarVisible

The IsTaskBarVisible routine returns the current visibility state of the taskbar.

Boolean IsTaskBarVisible(void);
function result
If the taskbar is visible, the function returns true .

ShowHideTaskBar

The ShowHideTaskBar routine shows or hides the Windows taskbar.

void ShowHideTaskBar(Boolean showIt);
showIt
If true , show the taskbar. Otherwise, hide the taskbar.

This call can be used to hide the taskbar during full-screen movie playback.

QTMLAcquireWindowList

The QTMLAcquireWindowList function acquires exclusive access to the global list of (Macintosh-style) windows, so that the list will not change until you call QTMLReleaseWindowList .

void QTMLAcquireWindowList( void );

DISCUSSION

If you want to call the LMGetWindowList function or the FrontWindow function and then proceed to walk down the next pointers, you need to protect yourself against another thread modifying the list while you walk. Call the QTMLAcquireWindowList function before and the QTMLReleaseWindowList routine after.

QTMLReleaseWindowList

The QTMLReleaseWindowList function allows other threads to modify the global list of (Macintosh-style) windows again.

void QTMLReleaseWindowList( void );

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |